home *** CD-ROM | disk | FTP | other *** search
/ Canadian Geographic Explorer / Canadian Geographic Explorer.iso / pc / riddler.dxr / 00048_Another Player Attempts Guess.ls < prev    next >
Encoding:
Text File  |  1996-10-03  |  1.3 KB  |  37 lines

  1. on keyDown
  2.   global gOrder, gWhoBuzzedIn, gScoreList, gValue, gSoundFXChannel, gPathToSound, fileDelimiter, gVoiceChannel, gCurrQString, gNumPlayers
  3.   set jKey to the keyPressed
  4.   set jRight to 0
  5.   case jKey of
  6.     "1":
  7.       if getAt(gOrder, 1) = 1 then
  8.         set jRight to 1
  9.       end if
  10.     "2":
  11.       if getAt(gOrder, 2) = 1 then
  12.         set jRight to 1
  13.       end if
  14.     "3":
  15.       if getAt(gOrder, 3) = 1 then
  16.         set jRight to 1
  17.       end if
  18.     otherwise:
  19.       exit
  20.   end case
  21.   if jRight then
  22.     sound playFile gSoundFXChannel, gPathToSound & "soundFX" & fileDelimiter & getAt(["liteclap", "medclap", "loudclap"], random(3)) & ".aif"
  23.     sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "CH" & gCurrQString & "_1.aif"
  24.     setAt(gScoreList, gWhoBuzzedIn, getAt(gScoreList, gWhoBuzzedIn) + (gValue * 100))
  25.     repeat while soundBusy(gVoiceChannel)
  26.     end repeat
  27.     sound stop gSoundFXChannel
  28.     go("Play Round")
  29.   else
  30.     setAt(gScoreList, gWhoBuzzedIn, getAt(gScoreList, gWhoBuzzedIn) - (gValue * 100))
  31.     go("AHNN!")
  32.   end if
  33.   set the text of field "player1 score" to string(getAt(gScoreList, 1))
  34.   set the text of field "player2 score" to string(getAt(gScoreList, 2))
  35.   set the text of field "player3 score" to string(getAt(gScoreList, 3))
  36. end
  37.